import 'package:flutter/material.dart';

class DetailPage extends StatefulWidget {
  final String pageTitle;
  final String pageContent;

  DetailPage(this.pageTitle, this.pageContent);

  @override
  State<StatefulWidget> createState() => new DetailPageState();
}

class DetailPageState extends State<DetailPage> {

  @override
  Widget build(BuildContext context) {
    AppBar _appBar;
    if(widget.pageTitle!=null && widget.pageTitle!="") {
      _appBar = new AppBar(
        centerTitle: true,
        title: new Text(widget.pageTitle, style: new TextStyle(color: Colors.white),),
        iconTheme: new IconThemeData(color: Colors.white),
      );
    }
    
    return new Scaffold(
      appBar: _appBar,
      body: new Center(
        child: new Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            new Text(widget.pageContent),
          ],
        ),
      )
    );
  }
}